package d0324;

public class StringTest {
    public static void main(String[] args) {
        int i=10;
        //将i转换为String类型
        String si=String.valueOf(i);
        System.out.println(si);
        char[] c1={'h','e','l','l','o'};
        //将char数组转换为String类型
        String sc1=String.valueOf(c1);

        // 将char数组中的第1到第4个字符转换为String类型
        String sc2=String.valueOf(c1,1,4);

        //分别输出hello及ello
        System.out.println(sc1);
        System.out.println(sc2);

//        String s = "beijingETC";
//        System.out.println(s.indexOf('i'));
//        System.out.println(s.lastIndexOf('i'));
//        System.out.println(s.indexOf('i', 3));
//        System.out.println(s.indexOf("jing"));
//        System.out.println(s.indexOf("jing", 4));
//        System.out.println(s.charAt(2));

        String str3="jack,22,dalian";
        String str4 = str3.replaceAll(",","-");
        System.out.println(str4);
    }

}
